package com.huiyeji.hui.service;

import com.huiyeji.hui.entity.Invitation;
import com.huiyeji.hui.vo.InvitationVo;
import com.huiyeji.hui.vo.MessageVo;

import java.util.List;

/**
 * @author zhaoduo
 */
public interface InvitationService {

    /**
     * 得到该用户收到的所有邀请函
     * @param receiver 用户id
     * @return List<InvitationVo
     */
    List<InvitationVo> getInvitations(Long receiver);

    /**
     * 发送群聊邀请,若邀请已存在则更新邀请时间为最新
     * @param vo MessageVo
     * @return List<Invitation>
     */
    List<Invitation> addGroupInvitation(MessageVo vo);

    /**
     * 发送私聊邀请,若邀请已存在则更新邀请时间为最新
     * @param vo MessageVo
     * @return Invitation
     */
    Invitation addFriendInvitation(MessageVo vo);

    /**
     * 拒绝邀请
     * @param uid uid
     * @param id invitation id
     */
    void refuseInvitation(Long uid, Long id);

    /**
     * 同意邀请
     * @param uid uid
     * @param id invitation id
     */
    void agreeInvitation(Long uid, Long id);

    /**
     * 获得一条邀请函
     * @param id id
     */
    Invitation getInvitation(Long id);

    /**
     * 删除与该群聊相关的所有邀请函
     * @param gid gid
     */
    void deleteAllGroupInvitation(Long gid);

    /**
     * 删除某条邀请函(只能删除receiver为该用户,已经同意或拒绝的邀请函)
     * @param uid uid
     * @param id id
     */
    void delete(Long uid, Long id);
}
